Motor driver command message
The motor driver can be controlled remotely over a communication interface, such as CAN Bus. Two parameters are needed: Mode and command. Both of them are described in the Driver documentation.
When this message is used for commanding the controller, the Application is overridden and the motor driver is controlled directly by the message. This override has a timeout of 200 ms. If no motor driver command message arrives within 200 ms, the motor driver will be controlled by the Application again.
If the number of bytes in the payload is even, the first byte in the payload must contain a live counter. The receiver must increment this live counter in every transmit instance, otherwise, the message will be ignored. This is to prevent a runaway situation (e.g. the transmitter is repeating the same message payload without linkage to its process context).
There are several formats of motor driver command messages. The difference is in message length and datatypes.
All here listed messages are unicast with SID = 25
Driver command 1 (fixed point command)
without live counter (payload length = 3)
Payload byte | Datatype | Description |
---|---|---|
0 | uint8 | Driver mode |
1-2 | int16 | Driver cmd , -32768 - 32767 mapped to range -1 - 1. Value is transfered as big-endian. (MSB first) |
with live counter (payload length = 4)
Payload byte | Datatype | Description |
---|---|---|
0 | uint8 | live counter |
1 | uint8 | Driver mode |
2-3 | int16 | Driver cmd , -32768 - 32767 mapped to range -1 - 1. Value is transfered as big-endian. (MSB first) |
Driver command 2 (floating point command)
without live counter (payload length = 5)
Payload byte | Datatype | Description |
---|---|---|
0 | uint8 | Driver mode |
1-4 | float | Driver cmd . Float value is transfered as big-endian. (MSB first) |
with live counter (payload length = 6)
Payload byte | Datatype | Description |
---|---|---|
0 | uint8 | live counter |
1 | uint8 | Driver mode |
2-5 | float | Driver cmd . Float value is transfered as big-endian. (MSB first) |
Driver command 3 (fixed point command with multipliers)
without live counter (payload length = 7)
Payload byte | Datatype | Description |
---|---|---|
0 | uint8 | Driver mode |
1-2 | int16 | Driver cmd , -32768 - 32767 mapped to range -1 - 1. Value is transfered as big-endian. (MSB first) |
3-4 | uint16 | Driver imult and rmult , 0 - 65535 mapped to range 0 - 1 |
5-6 | uint16 | Driver umult , 0 - 65535 mapped to range 0 - 1 |